<script setup>
import { ref } from 'vue'
import { useRouter } from "vue-router";
const router = useRouter()
const todemo = () => {
  router.push({ path: '/demo' })
}
const tohello = () => {
  router.push({ path: '/hello' })
}
let students = [
  { name: '一', sn: '1' },
  { name: '二', sn: '2' },
  { name: '三', sn: '3' },
  { name: '四', sn: '4' },
  { name: '五', sn: '5' }
];
let inputValue = ref('aaa')
const btnEvent = () => {
  console.info(inputValue.value)
}
let time = ref(new Date())
setInterval(() => {
  time.value = new Date()
}, 1000)
</script>
<template>
  <form>
    <table border="1" cellpadding="10" cellspacing="0">
      <tr>
        <td>序号</td>
        <td>姓名</td>
        <td>学号</td>
      </tr>
      <tr v-for="(items, index) in students" :key="index">
        <td>{{ index + 1 }}</td>
        <td>{{ items.name }}</td>
        <td>{{ items.sn }}</td>
      </tr>
    </table>
  </form>
  <input v-model="inputValue" type="text"><br>
  <button id="bth" @click="btnEvent">按钮</button>
  值为：{{ inputValue }}
  时间：{{ time }}
</template>
<style scoped>
</style>